package com.lj.infoisland.domain.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 评论表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "news_comments")
public class NewsComments implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;


    /*
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 新闻id
     */
    @TableField(value = "news_id")
    private String newsId;

    /**
     * 用户id
     */
    @TableField(value = "user_unique_id")
    private String userUniqueId;

    /**
     * 父级评论id，用于实现多级评论
     */
    @TableField(value = "parent_id")
    private Long parentId;

    /**
     * 评论内容
     */
    @TableField(value = "content")
    private String content;

    /**
     * 评论目标name
     */
    @TableField(value = "target")
    private String target;

    /**
     * 评论时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date createdAt;
}